package com.wm.javamall.cart.service;



import com.baomidou.mybatisplus.extension.service.IService;
import com.wm.common.vo.MemberRespVo;
import com.wm.javamall.cart.entity.CartEntity;
import com.wm.javamall.cart.vo.Cart;
import com.wm.javamall.cart.vo.CartItem;

import java.util.List;
import java.util.concurrent.ExecutionException;

/**
 * @Author: sshdg
 * @Date: 2021/2/19 19:20
 */
public interface CartService extends IService<CartEntity> {
    /**
     * 将商品添加到购物车
     * @param skuId
     * @param num
     * @return
     * @throws ExecutionException
     * @throws InterruptedException
     */
    void addToCart(Long skuId, Integer num) throws ExecutionException, InterruptedException;

    /**
     * 获取购物车中某个购物项
     * @param skuId
     * @return
     */
    CartItem getCartItem(Long skuId);

    Cart getCart() throws ExecutionException, InterruptedException;



    /**
     * 勾选购物项
     * @param skuId
     * @param check
     */
    void checkItem(Long skuId, Integer check);

    /**
     * 修改购物项数量
     * @param skuId
     * @param num
     */
    void changeItemCount(Long skuId, Integer num);

    /**
     * 删除购物项
     * @param skuId
     */
    void deleteItem(Long skuId);


    List<CartItem> getUserCartItems(MemberRespVo memberRespVo);
}
